<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 写一个函数，实现对数字数组的排序。
        function a (arr) {
            for (i = 0; i < arr.length - 1; i++) {
                for (j = 0; j < arr.length - 1 - i; j++) {
                    if (arr[j] > arr[j + 1]) {
                        var tem = arr[j]
                        arr[j] = arr[j + 1]
                        arr[j + 1] = tem
                    }
                }
            }
            return arr
        }
        var arr1 = a([5,7,4,9,6])
        console.log(arr1);
    </script>
</body>
</html>